#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#if 0
#define MAX 100
#define STR "hello"
int main()
{
	int m = MAX;
	printf("%d\n", m);
	printf("%s\n", STR);
	return 0;
}
#endif
#if 0
#define square(x) ((x)*(x))
int main()
{
	int m = 5;
	int ret = square(m+1);
	printf("%d\n", ret);
	return 0;
}
#endif
#if 0
#define MAX(x,y) ((x)>(y)?(x):(y))
int main()
{
	/*int a = 3;
	int b = 5;
	int max = MAX(a, b);
	printf("%d\n", max);*/
	int c = 6;
	int d = 7;
	int Max = MAX(c++, ++d);
	/*int Max=((c++)>(++d)?(c++):(++d))
	            6     8           9
	           c=7                   */
	printf("%d\n", Max);//9
	printf("%d\n", c);//7
	printf("%d\n", d);//9
	return 0;
}
#endif
#if 0
#define MAX(a,b) ((a)>(b)?(a):(b))
#define M 10
int main()
{
	int c = 3;
	int d = 4;
	int ret = MAX(MAX(M,c), d);
	printf("%d\n", ret);
	return 0;
}
#endif
#if 0
#define F(n,type) (type*)malloc(n*sizeof(type))
int main()
{
	int* p = (int*)malloc(10 * sizeof(int));
	//F(n,type)->F(10,int)=malloc(10,int)
	int* ptr = F(10, int);
	return 0;
}
#endif
#if 0
#define PRINT(n,format) printf("the value of" #n "is "format"\n",n)    
int main()
{
	int a = 1;
	PRINT(a, "%d");
	int b = 20;
	PRINT(b, "%d");
	float c = 5.6f;
	PRINT(c, "%f");
	return 0;
}
#endif
#define MAX(type)     \
type type##_max(type x,type y)\
{  \
      return x>y?x:y;   \
}

MAX(int);
MAX(float);
int main()
{
	int r1 = int_max(3, 5);
	printf("%d\n", r1);
	float r2 = float_max(3.1f, 4.2f);
	printf("%f\n", r2);
	return 0;
}